package com.ibangnuo.manage.controller.wxpay;

import com.ibangnuo.api.wxpay.WxpayControllerApi;
import com.ibangnuo.framework.domain.request.wxpay.WxpayDomainRequest;
import com.ibangnuo.framework.model.response.ObjectResult;
import com.ibangnuo.manage.service.wxpay.WxpayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: wwy
 * @Date: 2020-01-17 12:24
 */
@RestController
@RequestMapping("/wx")
public class WxpayController implements WxpayControllerApi {
    @Autowired
    private WxpayService wxpayService;

    @Override
    public ObjectResult payTestResult() {
        return null;
    }

    /**
     * 微信支付接口
     * @param wxpayDomainRequest
     * @return
     */
    @PostMapping("/pay")
    @Override
    public ObjectResult wxPay(@RequestBody WxpayDomainRequest wxpayDomainRequest) {
        return wxpayService.pay(wxpayDomainRequest);
    }
}
